Current Location: Home> Function Categories> lcg_value

lcg_value

Combined linear congruent generator
Name:lcg_value
Category:math
Programming Language:php
One-line Description:Returns a pseudo-random number with a range of (0,1).

Definition and usage

lcg_value() combines linear congruent generators.

Example

 <?php
echo lcg_value ( ) ;
?>

Try it yourself

grammar

 lcg_value ( )

illustrate

lcg_value() returns a pseudo-random number with a range of (0, 1). This function combines two congruent generators with periods 2^31 - 85 and 2^31 - 249. The period of this function is equal to the product of these two prime numbers.

Similar Functions
  • Generate better random numbers mt_rand

    mt_rand

    Generatebetterrandom
  • Inverse hyperbolic sine asinh

    asinh

    Inversehyperbolicsin
  • Convert hexadecimal to decimal hexdec

    hexdec

    Converthexadecimalto
  • Square root sqrt

    sqrt

    Squareroot
  • Antihyperbolic tangent atanh

    atanh

    Antihyperbolictangen
  • Hyperbolic cosine cosh

    cosh

    Hyperboliccosine
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
  • Sow the random number generator seeds srand

    srand

    Sowtherandomnumberge
Popular Articles